package ch00.ch04;

/**
 *
 * 泛型及泛型边界 : 不同的饲养员只能 操作 对应类型的动物
 *
 * @Author lzp
 * @Date 2024-04-07
 */
public class Text01 {
    public static void main(String[] args) {

        //实例化动物
        GeZi geZi = new GeZi();
        Tiger tiger =new Tiger();

        //实例化饲养员
        BuRuAnimalSiYangYuan<BuRuAnimal> zs = new BuRuAnimalSiYangYuan<>();
        FeiQinAnimalSiYangYuan<FeiQinAnimal> ls = new FeiQinAnimalSiYangYuan<>();

        // 错误：通过边界，zs只能喂养哺乳动物
        // zs.WeiYang(geZi);
        ls.WeiYang(geZi);
        zs.WeiYang(tiger);

    }
}
